<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var t1 = new Date();
      console.log(t1);
      var t3 = new Date("2020/08/26");
      console.log(t3);

      var t2 = new Date("2020-08-30");
      console.log(t2);

      var t4 = new Date();

      console.log(t4.getFullYear());
      console.log(t4.getMonth());
      console.log(t4.getDate());
      console.log(t4.getHours());
      console.log(t4.getMinutes());
      console.log(t4.getSeconds());
      console.log(t4.getDay());
      console.log(t4.getTime());
      console.log(t4.valueOf());
     console.log(+t4);

      console.log(Date.now());
    

      function dateFomate(t) {
        var yy = t.getFullYear();
        var mm = t.getMonth() + 1;
        var dd = t.getDate();
        var hh = t.getHours();
        var MM = t.getMinutes();
        var ss = t.getSeconds();

        mm = mm < 10 ? "0" + mm : mm;
        dd = dd < 10 ? "0" + dd : dd;
        hh = hh < 10 ? "0" + hh : hh;
        MM = MM < 10 ? "0" + MM : MM;
        ss = ss < 10 ? "0" + ss : ss;

        return yy + "/" + mm + "/" + dd + "  " + hh + ":" + MM + ":" + ss;
      }


 setTimeout(() => {
    console.log(dateFomate(new Date()));
 }, 1000);
     
    </script>
  </body>
</html>
